import request from '@/config/axios'

// 查询持续集成列表
export const getCiPage = async (params: PageParam) => {
  return await request.get({ url: '/ciservice/gitlab/getCommitRecordsByConditions', params })
}

//查询用户组列表
export const getGroupList = () => {
  return request.get({ url: '/ciservice/gitlab/getGroupsByUserId' })
}

//查询仓库列表
export const getProjectList = (params) => {
  return request.get({ url: '/ciservice/gitlab/getProjectsByGroupId', params })
}

//获取日志
export const getJobLog = (uuid: number, stage: string) => {
  return request.get({ url: `/gitlab/cicd/getJobLog/${uuid}/${stage}` })
}

//获取人工审查路径树
export const getTree = (params) => {
  return request.get({ url: '/gitlab/cicd/getFileChanges', params })
}

//查询文件前后对比内容
export const getFileContent = (params) => {
  return request.get({ url: '/gitlab/cicd/getManualReviewResult', params })
}

export const login = async (data) => {
  return request.post({ url: 'https://itest-sast.geovisearth.com/sast/auth/login', data })
}

export const getProjectIdByName = async (data) => {
  return request.post({
    url: 'https://itest-sast.geovisearth.com/sast/api/getProjectIdByName',
    data,
    HJRequest: true
  })
}

export const getProjectVersionById = async (data) => {
  return request.post({
    url: 'https://itest-sast.geovisearth.com/sast/overview/listProjectVersion',
    data,
    HJRequest: true
  })
}
